package test;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

import mapper.TAppointmentMapper;
import mapper.THospitalMapper;
import mapper.TUserMapper;
import model.TAppointment;
import model.TDept;
import model.THospital;
import model.TUser;
import vo.AppointVO;

public class Task9Test1 extends BaseMapperTest {
	
	@Test
	public void test() {
		
		SqlSession sqlSession = getSqlSession();
		try {
			
			TAppointmentMapper appointmentMapper = sqlSession.getMapper(TAppointmentMapper.class);
			List<AppointVO> list = appointmentMapper.selectACountVO();
			System.out.println("医生姓名\t\t医院名称\t\t科室名称\t\t预约总数");
			for (AppointVO vo : list) {
				System.out.print(vo.getmName() + "\t");
				System.out.print(vo.gethName() + "\t");
				System.out.print(vo.getdName() + "\t");
				System.out.print(vo.getCount() + "\t");
				System.out.println();
			}
			
		} finally {
			sqlSession.commit();
			sqlSession.close();
		}
		
	}

}